<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
<%@ include file="/mete.jsp"%>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.2.min.js"></script>
<script src='${pageContext.request.contextPath }/js/validator/validator.js' type='text/javascript'></script>
</head>
<body>
	<div class="meijieContent">
		<div class="myform app_info">
		<form action="${pageContext.request.contextPath }/staff!add.do" class="form-horizontal n-validator n-yellow" id="frmApp" method="post" role="form" enctype="multipart/form-data">
			<h2>添加员工</h2>
			<ul>
            <table>
               <tr>
                    <td class="colname"><span class="warn">*</span>姓名:</td>
                    <td class="content"><input class="txt" id="name" name="NAME" placeholder="请输入客户名称" type="text"/></td>
               </tr>
               <tr>
                    <td class="colname"><span class="warn">*</span>帐号:</td>
                    <td class="content"><input class="txt" id="account" name="ACCOUNT" placeholder="请输入账号" type="text"/></td>
               </tr>
               <tr>
                    <td class="colname"><span class="warn">*</span>密码:</td>
                    <td class="content"><input class="txt" id="password" name="PASSWORD" placeholder="请输入密码" type="password"/></td>
               </tr>
               <tr>
                    <td class="colname"><span class="warn">*</span>员工编号:</td>
                    <td class="content"><input class="txt" id="emp_no" name="EMP_NO" placeholder="请输入员工编号" type="text"/></td>
               </tr>
               <tr>
                    <td class="colname"><span class="warn">*</span>联系电话:</td>
                    <td class="content"><input class="txt" id="mobile" name="MOBILE" placeholder="请输入联系电话" type="text"/></td>
               </tr>
               <tr>
                    <td class="colname"><span class="warn">*</span>所属网点:</td>
                    <td class="content">
	                    <select id="gasstation_id" name="GASSTATION_ID">
	                    	<option value="">--请--选--择--网--点--</option>
	                    	<c:forEach items="${gasstationList }" var="gasstation">
	                    		<option value="${gasstation.ID }">${gasstation.NAME }</option>
	                    	</c:forEach>
	                    </select>
                    </td>
               </tr>
               <tr>
                    <td class="colname"><span class="warn"></span>头像:</td>
                    <td class="content"><input id="icon_url" name="ICON" placeholder="请上传头像" type="file"/></td>
               </tr>
               <tr>
                    <td class="submit" colspan="2" align="center">
                    	<input class="submit" type="submit" value="保  存"/>
					</td>
               </tr>
            </table>
		</ul>
	</form>
	</div>
	</div>
</body>
<script type="text/javascript">

	$(function(){
		$("#frmApp").validator({
			rules: {},
			fields: {
			    "#name": "required",
			    "#account": "required",
			    "#password": "required",
			    "#emp_no": "required",
			    "#mobile": "mobile",
			},
			valid: function (form) {
				$.post(form.submit(),null,function(resq){
					var json = eval('('+resq+')');
					if(json.status == 0)
						alert(json.data);
				})
			},
			dataType:"json"
			});
		
		$.get("${pageContext.request.contextPath}/oil_web/staff!getGasstationList.do",null,function(resp){
			var json = eval("("+resp+")");
			$("#gasstation_id").html(json.data);
		})
	})
	
</script>
</html>
